package com.campus.common.enums;

public enum DeliveryTypeEnum {

    TAKEOUT(1, "外卖","W"),
    DINING_IN(2, "堂食","T"),
    SELF_PICKUP(3, "自取","Z");

    private final int value;
    private final String text;
    private final String flag;

    DeliveryTypeEnum(int value, String text, String flag) {
        this.value = value;
        this.text = text;
        this.flag = flag;
    }


    public int getValue() {
        return value;
    }


    public String getText() {
        return text;
    }

    public String getFlag() {
        return flag;
    }
    /**
     * Gets by value.
     *
     * @param value the value
     * @return the by value
     */
    public static DeliveryTypeEnum getByValue(int value) {
        for (DeliveryTypeEnum temp : DeliveryTypeEnum.values()) {
            if (temp.getValue() == value) {
                return temp;
            }
        }
        return null;
    }
}